package com.jsh.erp.controller.api;

import com.jsh.erp.service.log.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RequestMapping("/api")
@RestController
public class LogRemoteClientApi {

    @Autowired
    private LogService logService;

    @GetMapping("/log/insertLog")
    public void insertLog(@RequestParam("moduleName") String moduleName,
                          @RequestParam("content")String content,
                          @RequestParam("request") HttpServletRequest request) throws Exception {
        logService.insertLog(moduleName, content, request);
    }
}
